package com.distribute.framework.model;

import com.distribute.framework.core.web.helper.Utils;
import java.lang.reflect.Field;
import java.util.Date; 
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;

import javax.annotation.Resource;

import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.core.lang.*; 
import com.distribute.framework.core.web.helper.WebHelper.LzMap;
import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.util.IbatisMap;
import com.distribute.framework.config.*;
import com.distribute.framework.plugin.*;

@namespace("users/member")
public @caption("会员信息") @database(DatabaseNames.distribute_sys) @source("distribute_sys") @table("member") class Member implements java.io.Serializable
{
	private static final long serialVersionUID = 1l;
		
	
		
	private @caption("用户编号") @column("uid")    @primary  @notnull  @note("  ") Long uid;// 主键 非空     
			
 			
 			
 		
	
		
	private @caption("用户名") @column("username") @like  @hidden    @note("  ") String username;//     
			
 			
 			
 		
	
		
	private @caption("密码") @column("password")   @hidden    @note("  ") String password;//     
			
 			
 			
 		
	
		
	private @caption("头像") @column("header")   @hidden    @note("  ") String header;//     
			
 			
 			
 		
	
		
	private @caption("昵称") @column("nick_name") @like     @note("  ") String nickName;//     
			
 			
 			
 		
	
		
	private @caption("真实姓名") @column("real_name")      @note("  ") String realName;//     
			
 			
 			
 		
	
		
	private @caption("个人简介") @column("profile") @like  @hidden    @note("  ") String profile;//     
			
 			
 			
 		
	
		
	private @caption("邮箱") @column("email")   @hidden    @note("  ") String email;//     
			
 			
 			
 		
	
		
	private @caption("手机") @column("mobile") @like     @note("  ") String mobile;//     
			
 			
 			
 		
	
		
	private @caption("QQ") @column("qq")   @hidden    @note("  ") String qq;//     
			
 			
 			
 		
	
		
	private @caption("性别") @column("sex")   @hidden    @note(" 1:男 0:女  ") Short sex;// 1:男 0:女     
			
 			
 			
 		
	
		
	private @caption("所在地") @column("place")   @hidden    @relate("$place") @RelateClass(Region.class)  @note("  ") Long place;//     
			
 	private transient Region $place;//关联对象[省市地区]
 			
 			
 			
 		
	
		
	private @caption("生日") @column("birthday")   @hidden    @note("  ") Date birthday;//     
			
 			
 			
 		
	
		
	private @caption("上级") @column("m_top") @like     @note("  ") String mTop;//     
			
 			
 			
 		
	
		
	private @caption("上上级") @column("m_toptop") @like     @note("  ") String mToptop;//     
			
 			
 			
 		
	
		
	private @caption("上级编号") @column("t_top")      @note("  ") String tTop;//     
			
 			
 			
 		
	
		
	private @caption("上上级编号") @column("t_toptop")      @note("  ") String tToptop;//     
			
 			
 			
 		
	
		
	private @caption("配送商") @column("distributor")      @relate("$distributor") @RelateClass(Distributor.class)  @note("  ") Long distributor;//     
			
 	private transient Distributor $distributor;//关联对象[配送商信息]
 			
 			
 			
 		
	
		
	private @caption("openId") @column("openid")   @hidden   @notnull  @note("  ") String openid;// 非空     
			
 			
 			
 		
	
		
	private @caption("授权情况") @column("auth_status")      @note(" 0:未授权 1:已授权  ") Short authStatus;// 0:未授权 1:已授权     
			
 			
 			
 		
	
		
	private @caption("邀请码") @column("invitation_code")   @hidden    @note("  ") String invitationCode;//     
			
 			
 			
 		
	
		
	private @caption("添加时间") @column("add_time")     @notnull  @note("  ") Date addTime;// 非空     
			
 			
 			
 		
	
		
	private @caption("修改时间") @column("update_time")   @hidden    @note("  ") Date updateTime;//     
			
 			
 			
 		
	
		
	private @caption("状态") @column("status")     @notnull  @note(" 1:正常 0:无效  ") Short status;// 非空 1:正常 0:无效     
			
 			
 			
 		
	
	 
	//默认构造函数
	public Member(){ 
	
	}
	
	//主键构造函数
	public Member(Long id){
		this.uid = id;
	}
	
	/**所有字段构造函数 
	 Member(
	 	Utils.getString("")//用户名
	 	,Utils.getString("")//密码
	 	,Utils.getString("")//头像
	 	,Utils.getString("name")//昵称
	 	,Utils.getString("name")//真实姓名
	 	,Utils.getString("")//个人简介
	 	,Utils.getString("")//邮箱
	 	,Utils.getString("")//手机
	 	,Utils.getString("")//QQ
	 	,Utils.getShort("")//性别
	 	,Utils.getLong("")//所在地
	 	,Utils.getDate("")//生日
	 	,Utils.getString("top")//上级
	 	,Utils.getString("toptop")//上上级
	 	,Utils.getString("top")//上级编号
	 	,Utils.getString("toptop")//上上级编号
	 	,Utils.getLong("")//配送商
	 	,Utils.getString("")//openId [非空]
	 	,Utils.getShort("status")//授权情况
	 	,Utils.getString("code")//邀请码
	 	,Utils.getDate("time")//添加时间 [非空]
	 	,Utils.getDate("time")//修改时间
	 	,Utils.getShort("")//状态 [非空]
	 )
	**/
	public Member(String username,String password,String header,String nickName,String realName,String profile,String email,String mobile,String qq,Short sex,Long place,Date birthday,String mTop,String mToptop,String tTop,String tToptop,Long distributor,String openid,Short authStatus,String invitationCode,Date addTime,Date updateTime,Short status){
		
			
			
		this.username=username;
		
			
		this.password=password;
		
			
		this.header=header;
		
			
		this.nickName=nickName;
		
			
		this.realName=realName;
		
			
		this.profile=profile;
		
			
		this.email=email;
		
			
		this.mobile=mobile;
		
			
		this.qq=qq;
		
			
		this.sex=sex;
		
			
		this.place=place;
		
			
		this.birthday=birthday;
		
			
		this.mTop=mTop;
		
			
		this.mToptop=mToptop;
		
			
		this.tTop=tTop;
		
			
		this.tToptop=tToptop;
		
			
		this.distributor=distributor;
		
			
		this.openid=openid;
		
			
		this.authStatus=authStatus;
		
			
		this.invitationCode=invitationCode;
		
			
		this.addTime=addTime;
		
			
		this.updateTime=updateTime;
		
			
		this.status=status;
		
	}
	
	//设置非空字段
	public Member setNotNull(String openid,Date addTime,Short status){
		
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
		this.openid=openid;
		
			
			
			
		this.addTime=addTime;
		
			
			
		this.status=status;
		
		return this;
	}
	
	
		
	/** 用户编号 [非空]       **/
	public Member uid(Long uid){
		this.uid = uid;
		this.setSeted(F.uid);
		return this;
	}
	
		
	/** 用户名        **/
	public Member username(String username){
		this.username = username;
		this.setSeted(F.username);
		return this;
	}
	
		
	/** 密码        **/
	public Member password(String password){
		this.password = password;
		this.setSeted(F.password);
		return this;
	}
	
		
	/** 头像        **/
	public Member header(String header){
		this.header = header;
		this.setSeted(F.header);
		return this;
	}
	
		
	/** 昵称        **/
	public Member nickName(String nickName){
		this.nickName = nickName;
		this.setSeted(F.nickName);
		return this;
	}
	
		
	/** 真实姓名        **/
	public Member realName(String realName){
		this.realName = realName;
		this.setSeted(F.realName);
		return this;
	}
	
		
	/** 个人简介        **/
	public Member profile(String profile){
		this.profile = profile;
		this.setSeted(F.profile);
		return this;
	}
	
		
	/** 邮箱        **/
	public Member email(String email){
		this.email = email;
		this.setSeted(F.email);
		return this;
	}
	
		
	/** 手机        **/
	public Member mobile(String mobile){
		this.mobile = mobile;
		this.setSeted(F.mobile);
		return this;
	}
	
		
	/** QQ        **/
	public Member qq(String qq){
		this.qq = qq;
		this.setSeted(F.qq);
		return this;
	}
	
		
	/** 性别    1:男 0:女     **/
	public Member sex(Short sex){
		this.sex = sex;
		this.setSeted(F.sex);
		return this;
	}
	
		
	/** 所在地  [Region]      **/
	public Member place(Long place){
		this.place = place;
		this.setSeted(F.place);
		return this;
	}
	
		
	/** 生日        **/
	public Member birthday(Date birthday){
		this.birthday = birthday;
		this.setSeted(F.birthday);
		return this;
	}
	
		
	/** 上级        **/
	public Member mTop(String mTop){
		this.mTop = mTop;
		this.setSeted(F.mTop);
		return this;
	}
	
		
	/** 上上级        **/
	public Member mToptop(String mToptop){
		this.mToptop = mToptop;
		this.setSeted(F.mToptop);
		return this;
	}
	
		
	/** 上级编号        **/
	public Member tTop(String tTop){
		this.tTop = tTop;
		this.setSeted(F.tTop);
		return this;
	}
	
		
	/** 上上级编号        **/
	public Member tToptop(String tToptop){
		this.tToptop = tToptop;
		this.setSeted(F.tToptop);
		return this;
	}
	
		
	/** 配送商  [Distributor]      **/
	public Member distributor(Long distributor){
		this.distributor = distributor;
		this.setSeted(F.distributor);
		return this;
	}
	
		
	/** openId [非空]       **/
	public Member openid(String openid){
		this.openid = openid;
		this.setSeted(F.openid);
		return this;
	}
	
		
	/** 授权情况    0:未授权 1:已授权     **/
	public Member authStatus(Short authStatus){
		this.authStatus = authStatus;
		this.setSeted(F.authStatus);
		return this;
	}
	
		
	/** 邀请码        **/
	public Member invitationCode(String invitationCode){
		this.invitationCode = invitationCode;
		this.setSeted(F.invitationCode);
		return this;
	}
	
		
	/** 添加时间 [非空]       **/
	public Member addTime(Date addTime){
		this.addTime = addTime;
		this.setSeted(F.addTime);
		return this;
	}
	
		
	/** 修改时间        **/
	public Member updateTime(Date updateTime){
		this.updateTime = updateTime;
		this.setSeted(F.updateTime);
		return this;
	}
	
		
	/** 状态 [非空]   1:正常 0:无效     **/
	public Member status(Short status){
		this.status = status;
		this.setSeted(F.status);
		return this;
	}
	
	
	
	/**
	* 克隆对象
	**/
	public Member clone(){
		Member clone = new Member();
		
			
			
		clone.username=this.username;
		
			
		clone.password=this.password;
		
			
		clone.header=this.header;
		
			
		clone.nickName=this.nickName;
		
			
		clone.realName=this.realName;
		
			
		clone.profile=this.profile;
		
			
		clone.email=this.email;
		
			
		clone.mobile=this.mobile;
		
			
		clone.qq=this.qq;
		
			
		clone.sex=this.sex;
		
			
		clone.place=this.place;
		
			
		clone.birthday=this.birthday;
		
			
		clone.mTop=this.mTop;
		
			
		clone.mToptop=this.mToptop;
		
			
		clone.tTop=this.tTop;
		
			
		clone.tToptop=this.tToptop;
		
			
		clone.distributor=this.distributor;
		
			
		clone.openid=this.openid;
		
			
		clone.authStatus=this.authStatus;
		
			
		clone.invitationCode=this.invitationCode;
		
			
		clone.addTime=this.addTime;
		
			
		clone.updateTime=this.updateTime;
		
			
		clone.status=this.status;
		
		return clone;
	}
	
	
	
	
	
	/**
	 * 根据ID取会员信息
	 * @param id
	 * @return
	 */
	public static @api Member get(Long id){		
		return getMemberById(id);
	}
	
	
	/**
	 * 设置ID
	 * @param id
	 * @return
	 */
	public void setId(Long id){		
		this.uid = id;
	}
	
	
	/**
	 * 获取所有会员信息
	 * @return
	 */
	public static @api List<Member> list(Map params,Integer size){
		return getMemberList(params,size);
	}
	/**
	 * 获取会员信息分页
	 * @return
	 */
	public static @api Page<Member> page(Integer page,Integer size,Map params){
		return getMemberPage(page, size , params);
	}
	
	
	/**
	 * 根据查询条件取会员信息
	 * @param params
	 * @return
	 */
	public static @api Member Get(Map params){
		return getMember(params);
	}
	/**
	 * 获取会员信息数
	 * @return
	 */
	public static @api Long count(Map params){
		return getMemberCount(params);
	}
	/**
	 * 获取会员信息数
	 * @return
	 */
	public static @api <T> T eval(String eval,Map params){
		return getMemberEval(eval,params);
	}
	
	
	/**
	 * 获取会员信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey){
		return getMemberStats(params,sumKey,groupKey,-1);
	}
	/**
	 * 获取会员信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> stats(Map params,C sumKey,C groupKey,int dateType){
		return getMemberStats(params,sumKey,groupKey,dateType);
	}
	
	
	/**
	 * 根据ID取会员信息
	 * @param id
	 * @return
	 */
	public static @api Member getMemberById(Long id){		
		return getMemberDao().getMemberById(id);
	}
	
	
	/**
	 * 获取id
	 * @return
	 */
	public Long getId(){
		return this.uid;
	}
	
	
	
	/**
	 * 根据ID取会员信息的标识键值
	 * @param id
	 * @return
	 */
	public static @api String getKeyValue(Object key){
		Long id = Utils.parseLong(key);	
		if(id==null || id.longValue()==0 ){
			
			return null;
			
		}
		String value = null;
		
		value = Cache.getValue(Member.class, id);
				
		if(value==null){
			Member member = get(id);
			if(member!=null){
				String strValue = member.getNickName$();
				
				if(!"NickName".equals("NickName"))
					strValue+="("+member.getNickName$()+")";
				
				
				Cache.setValue(Member.class, id ,strValue);
				
				value = strValue;
			}else{
				
				Cache.setValue(Member.class, id ,"{"+id+"}",30);
				
				value = "{"+id+"}";
			}
		}
		
		/************LAZY3Q_ID_KEYVALUE************/
		/************LAZY3Q_ID_KEYVALUE************/
		return value;
	}	
	
	
	/**
	 * 获取当前对象的键值
	 * @return
	 */
	public String getKeyValue(){
		
		/************LAZY3Q_CODE_KEYVALUE************/
		/************LAZY3Q_CODE_KEYVALUE************/
		String keyValue = this.getNickName$();
		
		if(!"NickName".equals("NickName"))
			keyValue+="("+this.getNickName$()+")";
		
		return keyValue;
	}
	
	
	/**
	 * 根据关键字精确查询会员信息对象
	 * @return
	 */
	public static @api Member find(String key){
		if(Utils.empty(key))return null;
		Map params = new HashMap();
		if(key.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
			params.put("uid", key.toLowerCase().replaceFirst("id:", ""));					
		else{//按标识查询，精确查询
			String strDefinex = "";
			
			strDefinex+=" or nick_name = '"+key.replaceAll("'", "''")+"'";
			
			strDefinex="(2=1 "+strDefinex+")";
			params.put("definex",strDefinex);
		}
		
		/************LAZY3Q_CODE_FIND************/
		/************LAZY3Q_CODE_FIND************/
		return Member.getMember(params);
	}
	
	
	/**
	 * 根据关键字查询会员信息
	 * @return
	 */
	public static @api List<Map> query(String key,int size,Map params,Boolean bObject){
		if(Utils.empty((String)params.get("asc")) && Utils.empty((String)params.get("desc")))//如果未传入排序字段
			params.put("desc","uid");//那么，默认以主键降序，传给Dao层
		String strTerm=key;		
		if(!Utils.empty(strTerm)){
			if(strTerm.toLowerCase().startsWith("id:"))//如果查询条件以id:开头，则按ID查询
				params.put("uid", strTerm.toLowerCase().replaceFirst("id:", ""));					
			else//按标识查询，模糊查询请带%
			{
				String strDefinex = "";
				
				strDefinex+=" or nick_name like '%"+strTerm.replaceAll("'", "''")+"%'";
				
				strDefinex="(2=1 "+strDefinex+")";
				params.put("definex",strDefinex);
			}
		}
		
		
		/************LAZY3Q_CODE_QUERY************/
		/************LAZY3Q_CODE_QUERY************/
			
		List<Member> list = page(0,size,params).getResult();
		
		/**
		* OK!取到数据拼成放入Map中，[{value,text,object:{...}},...]
		* value:数据ID，text:数据标识,object,整个对象
		**/
		List<Map> result = new java.util.ArrayList();
		for(Member member:list){
			Map map = new HashMap();
			map.put("key",member.getUid().toString());
			map.put("value", Utils.js(member.getKeyValue()));
			if(bObject==true)
				map.put("object",member);
			result.add(map);
		}
		
		
		/************LAZY3Q_AFTER_QUERY************/
		/************LAZY3Q_AFTER_QUERY************/
		
		return result;
	}
	
	
	
	/**
	 * 获取所有会员信息
	 * @return
	 */
	public static @api List<Member> getMemberList(Map params,Integer size){
		return getMemberDao().getMemberList(params,0,size);
	}
	
	/**
	 * 获取会员信息分页
	 * @return
	 */
	public static @api Page<Member> getMemberPage(Integer page,Integer size,Map params){
		if(page==null)page=0;
		if(size==null)size=20;
		return getMemberDao().getMemberPage(page, size , params);
	}
	
	/**
	 * 根据查询条件取会员信息
	 * @param params
	 * @return
	 */
	public static @api Member getMember(Map params){
		return getMemberDao().getMember(params);
	}
	
	/**
	 * 保存一个会员信息
	 * @param member
	 * @return
	 */
	public static @api Member saveMember(Member member){
		return getMemberDao().saveMember(member);
	}
	
	/**
	 * 根据条件更新会员信息
	 * @param values
	 * @param params
	 */
	public static @api int updateMemberByConfirm(Map values, Map params){
		return getMemberDao().updateMemberByConfirm(values,params);
	}
	
	/**
	 * 修改一个会员信息
	 * @param member
	 * @return
	 */
	public static @api int updateMember(Member member){
		return getMemberDao().updateMember(member);
	}
	
	/**
	 * 更新会员信息非空字段
	 * @param member
	 */
	public static @api int updateMember$NotNull(Member member){
		return getMemberDao().updateMember$NotNull(member);
	}
	
	/**
	 * 获取会员信息数
	 * @return
	 */
	public static @api Long getMemberCount(Map params){
		return getMemberDao().getMemberCount(params);
	}
		
		
	/**
	 * 获取会员信息自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public static @api <T> T getMemberEval(String eval,Map params){
		return getMemberDao().getMemberEval(eval,params);
	}
	
	
	/**
	 * 获取会员信息图表统计数据
	 * @param params 查询条件
	 * @param sumKey 统计的字段
	 * @param groupKey 分组的字段
	 * @param dateType 1:按年， 2：按月， 3：按周， 4：按日， 5：按小时， 6：月分， 7：日分， 8：点分
	 * @return
	 */
	public static @api List<Map> getMemberStats(Map params,C sumKey,C groupKey,int dateType){
		//TODO:图表统计功能未实现
		
		Map<String,Object> groups=new HashMap();//要分组的字段
		Map<String,Object> sums=new HashMap();//要统计的字段
		
		String[][] dateFormats=new String[][]{
				null,
				new String[]{"%Y","yyyy年","Y"},
				new String[]{"%Y-%m","yyyy年MM月","M"},
				new String[]{"%Y%U","yyyy年第ww周","W"},
				new String[]{"%Y-%m-%d","yyyy年MM月dd日","D"},
				new String[]{"%Y-%m-%d %H","yyyy年MM月dd日 HH点","H"},
				new String[]{"%m","MM月"},
				new String[]{"%d","dd号"},
				new String[]{"%H","HH点"} 
		};
		
		//获取要分组的字段，放入Map中
		if(dateType>0){
			groups.put(groupKey.toString(),"DATE_FORMAT({key},'"+dateFormats[dateType][0]+"')");
		}else{
			groups.put(groupKey.toString(),"{key}");
		}
		if(dateType<6 && dateType>0){ 
			params.put("asc", groupKey.toString()); 
			if(params.get(groupKey.name()+"Start")==null){
				params.put(groupKey.name()+"Start", Utils.date(new Date(), -24, dateFormats[dateType][2]));
			}
		}
		
		
		//获取要统计的字段，放入Map中
		if(sumKey.toString().equals("count")){
			sums.put(sumKey.toString(),"count(*)");
		}else{
			sums.put(sumKey.toString(),"sum({key})");
		}
		
		List<Map> list = getMemberDao().getMemberStats(params,groups,sums);
		
		List<Map> result = new ArrayList();
		for(Map m:list){
			Map map = new HashMap();
			Object value = m.get(sumKey.toString());
			Object name = null;
			Object groupValue = m.get(groupKey.toString());
			if(dateType>0){
				name = Utils.date(Utils.parseDate(groupValue), dateFormats[dateType][1]);
			}else{
				try{
					java.lang.reflect.Method method = Member.class.getMethod("get"+Utils.ForMat(groupKey.toString())+"$");
					method.setAccessible(true);
					name = method.invoke(Member.fromMap(m));
				}catch(Exception ex){
					ex.printStackTrace();
				}
			}
			map.put("name", name);
			map.put("value", value);
			result.add(map);
		}
		return result;
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static int updateMember(Map set,Map where){
		if(set.isEmpty())throw new RuntimeException("set为空");
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		return getMemberDao().updateMemberByConfirm(set, where);
	}
	
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void deleteMember(Map where){
		if(where.isEmpty())throw new RuntimeException("where为空");
		where.put("confirm", "1");
		getMemberDao().deleteMemberByConfirm(where);
	}
	
	/**
	 * 根据条件更新数据
	 * @param set
	 * @param where
	 */
	public static void delete(Long id){
		if(id==null)throw new RuntimeException("id为空");
		
		getMemberDao().removeMemberById(id);
		
	}
	
	
	/**
	 * 保存会员信息对象
	 * @param params
	 * @return
	 */
	public Member save(){
		if(this.getUid()!=null)
			getMemberDao().updateMember(this);
		else
			return getMemberDao().saveMember(this);
		return this;
	}
	
	
	/**
	 * 更新会员信息对象的非空字段,注意跟Service里面的update不一样哦
	 * @param params
	 * @return
	 */
	public int update(){
		return getMemberDao().updateMember$NotNull(this);
	}
	
	
	/**
	 * 删除
	 * @param params
	 * @return
	 */
	public void delete(){
		
		if(Utils.equals(Utils.config("logic_delete"),"true"))
			getMemberDao().removeMemberById(this.getUid());
		else
		
			getMemberDao().deleteMemberById(this.getUid());
	}
	
	/**
	 * 执行事务
	 * @param function
	 */
	public static <T> T execute(Function function){
		return getMemberDao().executeTransaction(function);
	}

	
	
	/*******************************用户编号**********************************/	
	/**
	* 用户编号 [非空]      
	**/
	public Long getUid(){
		
		if(this.uid!=null){
			return this.uid;
		}
		
		return this.uid;
	}
	/**
	* 获取用户编号格式化(toString)
	**/
	public String getUid$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getUid());
	 
	 	 return strValue;
	}
	/**
	* 根据用户编号反格式化
	**/
	public void setUid$(String strValue){
		if(Utils.empty(strValue)){
			this.uid=null;
			return;
		}
	
	
	 	this.uid=Utils.parseLong(strValue);
	 
	}
	
	/**
	* 用户编号 [非空]      
	**/
	public void setUid(Long uid){
		this.uid = uid;
		
		this.setSeted(F.uid);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************用户名**********************************/	
	/**
	* 用户名       
	**/
	public String getUsername(){
		
		if(this.username!=null){
			return this.username;
		}
		
		return this.username;
	}
	/**
	* 获取用户名格式化(toString)
	**/
	public String getUsername$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getUsername());
	 
	 	 return strValue;
	}
	/**
	* 根据用户名反格式化
	**/
	public void setUsername$(String strValue){
		if(Utils.empty(strValue)){
			this.username=null;
			return;
		}
	
	
	 	this.username=strValue;
	 
	}
	
	/**
	* 用户名       
	**/
	public void setUsername(String username){
		this.username = username;
		
		this.setSeted(F.username);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************密码**********************************/	
	/**
	* 密码       
	**/
	public String getPassword(){
		
		if(this.password!=null){
			return this.password;
		}
		
		return this.password;
	}
	/**
	* 获取密码格式化(toString)
	**/
	public String getPassword$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getPassword());
	 
	 	 return strValue;
	}
	/**
	* 根据密码反格式化
	**/
	public void setPassword$(String strValue){
		if(Utils.empty(strValue)){
			this.password=null;
			return;
		}
	
	
	 	this.password=strValue;
	 
	}
	
	/**
	* 密码       
	**/
	public void setPassword(String password){
		this.password = password;
		
		this.setSeted(F.password);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************头像**********************************/	
	/**
	* 头像       
	**/
	public String getHeader(){
		
		if(this.header!=null){
			return this.header;
		}
		
		return this.header;
	}
	/**
	* 获取头像格式化(toString)
	**/
	public String getHeader$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getHeader());
	 
	 	 return strValue;
	}
	/**
	* 根据头像反格式化
	**/
	public void setHeader$(String strValue){
		if(Utils.empty(strValue)){
			this.header=null;
			return;
		}
	
	
		this.header=Utils.parseString(strValue);
	 
	}
	
	/**
	* 头像       
	**/
	public void setHeader(String header){
		this.header = header;
		
		this.setSeted(F.header);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************昵称**********************************/	
	/**
	* 昵称       
	**/
	public String getNickName(){
		
		if(this.nickName!=null){
			return this.nickName;
		}
		
		return this.nickName;
	}
	/**
	* 获取昵称格式化(toString)
	**/
	public String getNickName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getNickName());
	 
	 	 return strValue;
	}
	/**
	* 根据昵称反格式化
	**/
	public void setNickName$(String strValue){
		if(Utils.empty(strValue)){
			this.nickName=null;
			return;
		}
	
	
	 	this.nickName=strValue;
	 
	}
	
	/**
	* 昵称       
	**/
	public void setNickName(String nickName){
		this.nickName = nickName;
		
		this.setSeted(F.nickName);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************真实姓名**********************************/	
	/**
	* 真实姓名       
	**/
	public String getRealName(){
		
		if(this.realName!=null){
			return this.realName;
		}
		
		return this.realName;
	}
	/**
	* 获取真实姓名格式化(toString)
	**/
	public String getRealName$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getRealName());
	 
	 	 return strValue;
	}
	/**
	* 根据真实姓名反格式化
	**/
	public void setRealName$(String strValue){
		if(Utils.empty(strValue)){
			this.realName=null;
			return;
		}
	
	
	 	this.realName=strValue;
	 
	}
	
	/**
	* 真实姓名       
	**/
	public void setRealName(String realName){
		this.realName = realName;
		
		this.setSeted(F.realName);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************个人简介**********************************/	
	/**
	* 个人简介       
	**/
	public String getProfile(){
		
		if(this.profile!=null){
			return this.profile;
		}
		
		return this.profile;
	}
	/**
	* 获取个人简介格式化(toString)
	**/
	public String getProfile$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getProfile());
	 
	 	 return strValue;
	}
	/**
	* 根据个人简介反格式化
	**/
	public void setProfile$(String strValue){
		if(Utils.empty(strValue)){
			this.profile=null;
			return;
		}
	
	
		this.profile=strValue;
	 
	}
	
	/**
	* 个人简介       
	**/
	public void setProfile(String profile){
		this.profile = profile;
		
		this.setSeted(F.profile);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************邮箱**********************************/	
	/**
	* 邮箱       
	**/
	public String getEmail(){
		
		if(this.email!=null){
			return this.email;
		}
		
		return this.email;
	}
	/**
	* 获取邮箱格式化(toString)
	**/
	public String getEmail$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getEmail());
	 
	 	 return strValue;
	}
	/**
	* 根据邮箱反格式化
	**/
	public void setEmail$(String strValue){
		if(Utils.empty(strValue)){
			this.email=null;
			return;
		}
	
	
	 	this.email=strValue;
	 
	}
	
	/**
	* 邮箱       
	**/
	public void setEmail(String email){
		this.email = email;
		
		this.setSeted(F.email);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************手机**********************************/	
	/**
	* 手机       
	**/
	public String getMobile(){
		
		if(this.mobile!=null){
			return this.mobile;
		}
		
		return this.mobile;
	}
	/**
	* 获取手机格式化(toString)
	**/
	public String getMobile$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getMobile());
	 
	 	 return strValue;
	}
	/**
	* 根据手机反格式化
	**/
	public void setMobile$(String strValue){
		if(Utils.empty(strValue)){
			this.mobile=null;
			return;
		}
	
	
	 	this.mobile=strValue;
	 
	}
	
	/**
	* 手机       
	**/
	public void setMobile(String mobile){
		this.mobile = mobile;
		
		this.setSeted(F.mobile);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************QQ**********************************/	
	/**
	* QQ       
	**/
	public String getQq(){
		
		if(this.qq!=null){
			return this.qq;
		}
		
		return this.qq;
	}
	/**
	* 获取QQ格式化(toString)
	**/
	public String getQq$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getQq());
	 
	 	 return strValue;
	}
	/**
	* 根据QQ反格式化
	**/
	public void setQq$(String strValue){
		if(Utils.empty(strValue)){
			this.qq=null;
			return;
		}
	
	
	 	this.qq=strValue;
	 
	}
	
	/**
	* QQ       
	**/
	public void setQq(String qq){
		this.qq = qq;
		
		this.setSeted(F.qq);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************性别**********************************/	
	/**
	* 性别    1:男 0:女    
	**/
	public Short getSex(){
		
		if(this.sex!=null){
			return this.sex;
		}
		
		return this.sex;
	}
	/**
	* 获取性别格式化(toString)
	**/
	public String getSex$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getSex()),"1"))
			strValue=Utils.string("男");		 
			
		 if(Utils.equals(Utils.string(this.getSex()),"0"))
			strValue=Utils.string("女");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据性别反格式化
	**/
	public void setSex$(String strValue){
		if(Utils.empty(strValue)){
			this.sex=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"男"))
		 	this.sex=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"女"))
		 	this.sex=Utils.parseShort("0");
			
		
	 
	}
	
	/**
	* 性别    1:男 0:女    
	**/
	public void setSex(Short sex){
		this.sex = sex;
		
		this.setSeted(F.sex);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************所在地**********************************/	
	/**
	* 所在地  [Region]     
	**/
	public Long getPlace(){
		
		if(this.place!=null){
			return this.place;
		}
		
		return this.place;
	}
	/**
	* 获取所在地格式化(toString)
	**/
	public String getPlace$(){
		String strValue="";
	
	
		 
		if(this.getPlace()!=null){
			
				strValue+=Utils.string(Region.getKeyValue(this.getPlace()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据所在地反格式化
	**/
	public void setPlace$(String strValue){
		if(Utils.empty(strValue)){
			this.place=null;
			return;
		}
	
	
		 
		Region item = Region.find(strValue);
		if(item!=null){
			
			this.place = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 所在地  [Region]     
	**/
	public void setPlace(Long place){
		this.place = place;
		
		this.setSeted(F.place);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[省市地区]
	**/	 			
 	public Region get$place(){
 		if(this.$place!=null)
 			return this.$place;
 		com.distribute.framework.model.Region region = null;
		if(this.getPlace()!=null){
		
 			region = Region.get(this.getPlace());
 		
 		}
 		return region;
	}
	
 	
	
	
	/*******************************生日**********************************/	
	/**
	* 生日       
	**/
	public Date getBirthday(){
		
		if(this.birthday!=null){
			return this.birthday;
		}
		
		return this.birthday;
	}
	/**
	* 获取生日格式化(toString)
	**/
	public String getBirthday$(){
		String strValue="";
	
	
	 	 
		 strValue=Utils.string(Utils.date(this.getBirthday(),"yyyy-MM-dd"));
		 
	 
	 	 return strValue;
	}
	/**
	* 根据生日反格式化
	**/
	public void setBirthday$(String strValue){
		if(Utils.empty(strValue)){
			this.birthday=null;
			return;
		}
	
	
	 	this.birthday=Utils.date(strValue,"yyyy-MM-dd");
	 
	}
	
	/**
	* 生日       
	**/
	public void setBirthday(Date birthday){
		this.birthday = birthday;
		
		this.setSeted(F.birthday);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************上级**********************************/	
	/**
	* 上级       
	**/
	public String getmTop(){
		
		if(this.mTop!=null){
			return this.mTop;
		}
		
		return this.mTop;
	}
	/**
	* 获取上级格式化(toString)
	**/
	public String getmTop$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getmTop());
	 
	 	 return strValue;
	}
	/**
	* 根据上级反格式化
	**/
	public void setmTop$(String strValue){
		if(Utils.empty(strValue)){
			this.mTop=null;
			return;
		}
	
	
	 	this.mTop=strValue;
	 
	}
	
	/**
	* 上级       
	**/
	public void setmTop(String mTop){
		this.mTop = mTop;
		
		this.setSeted(F.mTop);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************上上级**********************************/	
	/**
	* 上上级       
	**/
	public String getmToptop(){
		
		if(this.mToptop!=null){
			return this.mToptop;
		}
		
		return this.mToptop;
	}
	/**
	* 获取上上级格式化(toString)
	**/
	public String getmToptop$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getmToptop());
	 
	 	 return strValue;
	}
	/**
	* 根据上上级反格式化
	**/
	public void setmToptop$(String strValue){
		if(Utils.empty(strValue)){
			this.mToptop=null;
			return;
		}
	
	
	 	this.mToptop=strValue;
	 
	}
	
	/**
	* 上上级       
	**/
	public void setmToptop(String mToptop){
		this.mToptop = mToptop;
		
		this.setSeted(F.mToptop);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************上级编号**********************************/	
	/**
	* 上级编号       
	**/
	public String gettTop(){
		
		if(this.tTop!=null){
			return this.tTop;
		}
		
		return this.tTop;
	}
	/**
	* 获取上级编号格式化(toString)
	**/
	public String gettTop$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.gettTop());
	 
	 	 return strValue;
	}
	/**
	* 根据上级编号反格式化
	**/
	public void settTop$(String strValue){
		if(Utils.empty(strValue)){
			this.tTop=null;
			return;
		}
	
	
	 	this.tTop=strValue;
	 
	}
	
	/**
	* 上级编号       
	**/
	public void settTop(String tTop){
		this.tTop = tTop;
		
		this.setSeted(F.tTop);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************上上级编号**********************************/	
	/**
	* 上上级编号       
	**/
	public String gettToptop(){
		
		if(this.tToptop!=null){
			return this.tToptop;
		}
		
		return this.tToptop;
	}
	/**
	* 获取上上级编号格式化(toString)
	**/
	public String gettToptop$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.gettToptop());
	 
	 	 return strValue;
	}
	/**
	* 根据上上级编号反格式化
	**/
	public void settToptop$(String strValue){
		if(Utils.empty(strValue)){
			this.tToptop=null;
			return;
		}
	
	
	 	this.tToptop=strValue;
	 
	}
	
	/**
	* 上上级编号       
	**/
	public void settToptop(String tToptop){
		this.tToptop = tToptop;
		
		this.setSeted(F.tToptop);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************配送商**********************************/	
	/**
	* 配送商  [Distributor]     
	**/
	public Long getDistributor(){
		
		if(this.distributor!=null){
			return this.distributor;
		}
		
		return this.distributor;
	}
	/**
	* 获取配送商格式化(toString)
	**/
	public String getDistributor$(){
		String strValue="";
	
	
		 
		if(this.getDistributor()!=null){
			
				strValue+=Utils.string(Distributor.getKeyValue(this.getDistributor()));
			
		}			
		 
	 
	 	 return strValue;
	}
	/**
	* 根据配送商反格式化
	**/
	public void setDistributor$(String strValue){
		if(Utils.empty(strValue)){
			this.distributor=null;
			return;
		}
	
	
		 
		Distributor item = Distributor.find(strValue);
		if(item!=null){
			
			this.distributor = Utils.parseLong(item.getId());
			
		}
		 
	 
	}
	
	/**
	* 配送商  [Distributor]     
	**/
	public void setDistributor(Long distributor){
		this.distributor = distributor;
		
		this.setSeted(F.distributor);
		
	}
	
	
		 
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 		
	/**
	* 获取关联对象[配送商信息]
	**/	 			
 	public Distributor get$distributor(){
 		if(this.$distributor!=null)
 			return this.$distributor;
 		com.distribute.framework.model.Distributor distributor = null;
		if(this.getDistributor()!=null){
		
 			distributor = Distributor.get(this.getDistributor());
 		
 		}
 		return distributor;
	}
	
 	
	
	
	/*******************************openId**********************************/	
	/**
	* openId [非空]      
	**/
	public String getOpenid(){
		
		if(this.openid!=null){
			return this.openid;
		}
		
		return this.openid;
	}
	/**
	* 获取openId格式化(toString)
	**/
	public String getOpenid$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getOpenid());
	 
	 	 return strValue;
	}
	/**
	* 根据openId反格式化
	**/
	public void setOpenid$(String strValue){
		if(Utils.empty(strValue)){
			this.openid=null;
			return;
		}
	
	
	 	this.openid=strValue;
	 
	}
	
	/**
	* openId [非空]      
	**/
	public void setOpenid(String openid){
		this.openid = openid;
		
		this.setSeted(F.openid);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************授权情况**********************************/	
	/**
	* 授权情况    0:未授权 1:已授权    
	**/
	public Short getAuthStatus(){
		
		if(this.authStatus!=null){
			return this.authStatus;
		}
		
		return this.authStatus;
	}
	/**
	* 获取授权情况格式化(toString)
	**/
	public String getAuthStatus$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getAuthStatus()),"0"))
			strValue=Utils.string("未授权");		 
			
		 if(Utils.equals(Utils.string(this.getAuthStatus()),"1"))
			strValue=Utils.string("已授权");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据授权情况反格式化
	**/
	public void setAuthStatus$(String strValue){
		if(Utils.empty(strValue)){
			this.authStatus=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"未授权"))
		 	this.authStatus=Utils.parseShort("0");
			
		 if(Utils.equals(strValue,"已授权"))
		 	this.authStatus=Utils.parseShort("1");
			
		
	 
	}
	
	/**
	* 授权情况    0:未授权 1:已授权    
	**/
	public void setAuthStatus(Short authStatus){
		this.authStatus = authStatus;
		
		this.setSeted(F.authStatus);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************邀请码**********************************/	
	/**
	* 邀请码       
	**/
	public String getInvitationCode(){
		
		if(this.invitationCode!=null){
			return this.invitationCode;
		}
		
		return this.invitationCode;
	}
	/**
	* 获取邀请码格式化(toString)
	**/
	public String getInvitationCode$(){
		String strValue="";
	
	
		 strValue=Utils.string(this.getInvitationCode());
	 
	 	 return strValue;
	}
	/**
	* 根据邀请码反格式化
	**/
	public void setInvitationCode$(String strValue){
		if(Utils.empty(strValue)){
			this.invitationCode=null;
			return;
		}
	
	
	 	this.invitationCode=strValue;
	 
	}
	
	/**
	* 邀请码       
	**/
	public void setInvitationCode(String invitationCode){
		this.invitationCode = invitationCode;
		
		this.setSeted(F.invitationCode);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************添加时间**********************************/	
	/**
	* 添加时间 [非空]      
	**/
	public Date getAddTime(){
		
		if(this.addTime!=null){
			return this.addTime;
		}
		
		return this.addTime;
	}
	/**
	* 获取添加时间格式化(toString)
	**/
	public String getAddTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getAddTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据添加时间反格式化
	**/
	public void setAddTime$(String strValue){
		if(Utils.empty(strValue)){
			this.addTime=null;
			return;
		}
	
	
	 	this.addTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 添加时间 [非空]      
	**/
	public void setAddTime(Date addTime){
		this.addTime = addTime;
		
		this.setSeted(F.addTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************修改时间**********************************/	
	/**
	* 修改时间       
	**/
	public Date getUpdateTime(){
		
		if(this.updateTime!=null){
			return this.updateTime;
		}
		
		return this.updateTime;
	}
	/**
	* 获取修改时间格式化(toString)
	**/
	public String getUpdateTime$(){
		String strValue="";
	
	
	 	
		 strValue=Utils.string(Utils.date(this.getUpdateTime(),"yyyy-MM-dd HH:mm:ss"));
		
	 
	 	 return strValue;
	}
	/**
	* 根据修改时间反格式化
	**/
	public void setUpdateTime$(String strValue){
		if(Utils.empty(strValue)){
			this.updateTime=null;
			return;
		}
	
	
	 	this.updateTime=Utils.date(strValue,"yyyy-MM-dd HH:mm:ss");
	 
	}
	
	/**
	* 修改时间       
	**/
	public void setUpdateTime(Date updateTime){
		this.updateTime = updateTime;
		
		this.setSeted(F.updateTime);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	/*******************************状态**********************************/	
	/**
	* 状态 [非空]   1:正常 0:无效    
	**/
	public Short getStatus(){
		
		if(this.status!=null){
			return this.status;
		}
		
		return this.status;
	}
	/**
	* 获取状态格式化(toString)
	**/
	public String getStatus$(){
		String strValue="";
	
	
		
			
		 if(Utils.equals(Utils.string(this.getStatus()),"1"))
			strValue=Utils.string("正常");		 
			
		 if(Utils.equals(Utils.string(this.getStatus()),"0"))
			strValue=Utils.string("无效");		 
			
		
	 
	 	 return strValue;
	}
	/**
	* 根据状态反格式化
	**/
	public void setStatus$(String strValue){
		if(Utils.empty(strValue)){
			this.status=null;
			return;
		}
	
	
		
			
		 if(Utils.equals(strValue,"正常"))
		 	this.status=Utils.parseShort("1");
			
		 if(Utils.equals(strValue,"无效"))
		 	this.status=Utils.parseShort("0");
			
		
	 
	}
	
	/**
	* 状态 [非空]   1:正常 0:无效    
	**/
	public void setStatus(Short status){
		this.status = status;
		
		this.setSeted(F.status);
		
	}
	
	
	
	
	
	
	
	
	
	
 	
 	
	
	
	
	
	
 	
 	
 	
	
	
	
	/************LAZY3Q_DEFINE_CODE************/
	/************LAZY3Q_DEFINE_CODE************/	
	
	
	/**
	 * 触发器
	 */
	public static void on(Trigger.Index index,final Notify.Listener listener,Trigger.Type... types){
		Notify.on(Member.class, index, listener, types);
	}
	public static void on(final Notify.Listener listener,String type){
		Notify.on(Member.class, listener, type);
	}
	/**
	 * 当修改字段时
	 * @param filedName
	 * @param listener
	 */
	public static void on(String filedName,final Notify.Listener listener){
		Notify.on(Member.class, listener, filedName);
	}
	/**
	 * 当修改字段为某值时
	 * @param filedName
	 * @param value
	 * @param listener
	 */
	public static void on(String filedName,Object value,final Notify.Listener listener){
		if(value==null)return;
		Notify.on(Member.class, listener, filedName+"."+Utils.md5(""+value));
	}
	public void notify(String type){
		Trigger.on(Member.class,type, this);
	}
	
	
	/**
	 * 用来获取当有字段关联对象时的获取方式,调用如${Member.obj.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${Member.$filedName}获取关联对象
	 */
	public Map getObj(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return Member.class.getMethod("get$"+Utils.forMat(key.toString())).invoke(Member.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 用来获取某字段格式化的获取方式,调用如${Member.fmt.filedName}
	 * 因为有些变态的模板语言不能识别$，所以不能以${Member.filedName$}获取某字段格式化
	 */
	public Map getFmt(){
		return new HashMap(){
			@Override
			public Object get(Object key) {
				try {
					return Member.class.getMethod("get"+Utils.ForMat(key.toString()+"$")).invoke(Member.this);
				} catch (Exception e) {
					e.printStackTrace();
				}
				return null;
			}
		};
	}
	/**
	 * 获取查询参数链式串
	 * @return
	 */
	public static @Deprecated M where(){ return new M(0); }
	public static @Deprecated M m(){ return new M(0); }
	public static M where = new M(0,true);
	public static @database(DatabaseNames.distribute_sys) class M extends IbatisMap{
		int type = 0; 
		M linked = null;
		Boolean proxy = false;
		public M set = null;
		public M(int type){
			this.type = type;
			if(this.type==0){
				set = new M(1,true);
				set.linked = this;
			}
		};
		public M(int type,Boolean proxy){
			this.type = type;
			this.proxy=proxy;
		};
		public M proxy(){
			M m = new M(this.type);//当前的对像
			if(this.type==0){
				m.set = new M(1,true);//set对象
				m.set.linked = m;
			}else{
				m.linked=this.linked;
				this.linked.linked=m;
			}
			return m;
		}
		public @Deprecated M set(){			
			M m = this;
			m.linked=new M(1);
			m.linked.linked=m;
			return m.linked;
		};
		
		public M on(IbatisMap value,C column,String joinColumn){if(proxy)return proxy().on(value,column,joinColumn);this.put(value.getClass().getDeclaringClass().getSimpleName(), value);value.put("on", column.toString());value.put("to", joinColumn);return this;};
		
		
			
		
		/** 用户编号 [非空]       **/
		public M uid(Object uid){if(proxy)return proxy().uid(uid);  this.put("uid", uid);return this;};
	 	/** and uid is null */
 		public M uidNull(){if(proxy)return proxy().uidNull();if(this.get("uidNot")==null)this.put("uidNot", "");this.put("uid", null);return this;};
 		/** not .... */
 		public M uidNot(){if(proxy)return proxy().uidNot();this.put("uidNot", "not");return this;};
 		public M uidNotNull(){if(proxy)return proxy().uidNotNull();this.put("uidNot", "not");this.put("uid", null);return this;};
 		public M uidNot(Object uid){if(proxy)return proxy().uidNot(uid);this.put("uidNot", "not");this.put("uid", uid);return this;};
	 		
		/** and uid <= ? */
		public M uidMin(Object min){if(proxy)return proxy().uidMin(min);this.put("uidMin", min);return this;};
		/** and uid >= ? */
		public M uidMax(Object max){if(proxy)return proxy().uidMax(max);this.put("uidMax", max);return this;};
			
			
		public M uidIn(String ids){
			if(proxy)return proxy().uidIn(ids);  this.put("uidIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 用户名        **/
		public M username(Object username){if(proxy)return proxy().username(username);  this.put("username", username);return this;};
	 	/** and username is null */
 		public M usernameNull(){if(proxy)return proxy().usernameNull();if(this.get("usernameNot")==null)this.put("usernameNot", "");this.put("username", null);return this;};
 		/** not .... */
 		public M usernameNot(){if(proxy)return proxy().usernameNot();this.put("usernameNot", "not");return this;};
 		public M usernameNotNull(){if(proxy)return proxy().usernameNotNull();this.put("usernameNot", "not");this.put("username", null);return this;};
 		public M usernameNot(Object username){if(proxy)return proxy().usernameNot(username);this.put("usernameNot", "not");this.put("username", username);return this;};
	 		
			
		
			
	 	
			
		
		/** 密码        **/
		public M password(Object password){if(proxy)return proxy().password(password);  this.put("password", password);return this;};
	 	/** and password is null */
 		public M passwordNull(){if(proxy)return proxy().passwordNull();if(this.get("passwordNot")==null)this.put("passwordNot", "");this.put("password", null);return this;};
 		/** not .... */
 		public M passwordNot(){if(proxy)return proxy().passwordNot();this.put("passwordNot", "not");return this;};
 		public M passwordNotNull(){if(proxy)return proxy().passwordNotNull();this.put("passwordNot", "not");this.put("password", null);return this;};
 		public M passwordNot(Object password){if(proxy)return proxy().passwordNot(password);this.put("passwordNot", "not");this.put("password", password);return this;};
	 		
			
		
			
	 	
			
		
		/** 头像        **/
		public M header(Object header){if(proxy)return proxy().header(header);  this.put("header", header);return this;};
	 	/** and header is null */
 		public M headerNull(){if(proxy)return proxy().headerNull();if(this.get("headerNot")==null)this.put("headerNot", "");this.put("header", null);return this;};
 		/** not .... */
 		public M headerNot(){if(proxy)return proxy().headerNot();this.put("headerNot", "not");return this;};
 		public M headerNotNull(){if(proxy)return proxy().headerNotNull();this.put("headerNot", "not");this.put("header", null);return this;};
 		public M headerNot(Object header){if(proxy)return proxy().headerNot(header);this.put("headerNot", "not");this.put("header", header);return this;};
	 		
			
		
			
	 	
			
		
		/** 昵称        **/
		public M nickName(Object nickName){if(proxy)return proxy().nickName(nickName);  this.put("nickName", nickName);return this;};
	 	/** and nick_name is null */
 		public M nickNameNull(){if(proxy)return proxy().nickNameNull();if(this.get("nickNameNot")==null)this.put("nickNameNot", "");this.put("nickName", null);return this;};
 		/** not .... */
 		public M nickNameNot(){if(proxy)return proxy().nickNameNot();this.put("nickNameNot", "not");return this;};
 		public M nickNameNotNull(){if(proxy)return proxy().nickNameNotNull();this.put("nickNameNot", "not");this.put("nickName", null);return this;};
 		public M nickNameNot(Object nickName){if(proxy)return proxy().nickNameNot(nickName);this.put("nickNameNot", "not");this.put("nickName", nickName);return this;};
	 		
			
		
			
	 	
			
		
		/** 真实姓名        **/
		public M realName(Object realName){if(proxy)return proxy().realName(realName);  this.put("realName", realName);return this;};
	 	/** and real_name is null */
 		public M realNameNull(){if(proxy)return proxy().realNameNull();if(this.get("realNameNot")==null)this.put("realNameNot", "");this.put("realName", null);return this;};
 		/** not .... */
 		public M realNameNot(){if(proxy)return proxy().realNameNot();this.put("realNameNot", "not");return this;};
 		public M realNameNotNull(){if(proxy)return proxy().realNameNotNull();this.put("realNameNot", "not");this.put("realName", null);return this;};
 		public M realNameNot(Object realName){if(proxy)return proxy().realNameNot(realName);this.put("realNameNot", "not");this.put("realName", realName);return this;};
	 		
			
		
			
	 	
			
		
		/** 个人简介        **/
		public M profile(Object profile){if(proxy)return proxy().profile(profile);  this.put("profile", profile);return this;};
	 	/** and profile is null */
 		public M profileNull(){if(proxy)return proxy().profileNull();if(this.get("profileNot")==null)this.put("profileNot", "");this.put("profile", null);return this;};
 		/** not .... */
 		public M profileNot(){if(proxy)return proxy().profileNot();this.put("profileNot", "not");return this;};
 		public M profileNotNull(){if(proxy)return proxy().profileNotNull();this.put("profileNot", "not");this.put("profile", null);return this;};
 		public M profileNot(Object profile){if(proxy)return proxy().profileNot(profile);this.put("profileNot", "not");this.put("profile", profile);return this;};
	 		
			
		
			
	 	
			
		
		/** 邮箱        **/
		public M email(Object email){if(proxy)return proxy().email(email);  this.put("email", email);return this;};
	 	/** and email is null */
 		public M emailNull(){if(proxy)return proxy().emailNull();if(this.get("emailNot")==null)this.put("emailNot", "");this.put("email", null);return this;};
 		/** not .... */
 		public M emailNot(){if(proxy)return proxy().emailNot();this.put("emailNot", "not");return this;};
 		public M emailNotNull(){if(proxy)return proxy().emailNotNull();this.put("emailNot", "not");this.put("email", null);return this;};
 		public M emailNot(Object email){if(proxy)return proxy().emailNot(email);this.put("emailNot", "not");this.put("email", email);return this;};
	 		
			
		
			
	 	
			
		
		/** 手机        **/
		public M mobile(Object mobile){if(proxy)return proxy().mobile(mobile);  this.put("mobile", mobile);return this;};
	 	/** and mobile is null */
 		public M mobileNull(){if(proxy)return proxy().mobileNull();if(this.get("mobileNot")==null)this.put("mobileNot", "");this.put("mobile", null);return this;};
 		/** not .... */
 		public M mobileNot(){if(proxy)return proxy().mobileNot();this.put("mobileNot", "not");return this;};
 		public M mobileNotNull(){if(proxy)return proxy().mobileNotNull();this.put("mobileNot", "not");this.put("mobile", null);return this;};
 		public M mobileNot(Object mobile){if(proxy)return proxy().mobileNot(mobile);this.put("mobileNot", "not");this.put("mobile", mobile);return this;};
	 		
			
		
			
	 	
			
		
		/** QQ        **/
		public M qq(Object qq){if(proxy)return proxy().qq(qq);  this.put("qq", qq);return this;};
	 	/** and qq is null */
 		public M qqNull(){if(proxy)return proxy().qqNull();if(this.get("qqNot")==null)this.put("qqNot", "");this.put("qq", null);return this;};
 		/** not .... */
 		public M qqNot(){if(proxy)return proxy().qqNot();this.put("qqNot", "not");return this;};
 		public M qqNotNull(){if(proxy)return proxy().qqNotNull();this.put("qqNot", "not");this.put("qq", null);return this;};
 		public M qqNot(Object qq){if(proxy)return proxy().qqNot(qq);this.put("qqNot", "not");this.put("qq", qq);return this;};
	 		
			
		
			
	 	
			
		
		/** 性别    1:男 0:女     **/
		public M sex(Object sex){if(proxy)return proxy().sex(sex);  this.put("sex", sex);return this;};
	 	/** and sex is null */
 		public M sexNull(){if(proxy)return proxy().sexNull();if(this.get("sexNot")==null)this.put("sexNot", "");this.put("sex", null);return this;};
 		/** not .... */
 		public M sexNot(){if(proxy)return proxy().sexNot();this.put("sexNot", "not");return this;};
 		public M sexNotNull(){if(proxy)return proxy().sexNotNull();this.put("sexNot", "not");this.put("sex", null);return this;};
 		public M sexNot(Object sex){if(proxy)return proxy().sexNot(sex);this.put("sexNot", "not");this.put("sex", sex);return this;};
	 		
			
		public M sexIn(String ids){
			if(proxy)return proxy().sexIn(ids);  this.put("sexIn", ids);return this;
		};	
 			
		
			
	 	
			
		public M place$on(Region.M value){if(proxy)return proxy().place$on(value);this.put("Place", value);value.put("on", "place");return this;};
 				
 			
		
		/** 所在地  [Region]      **/
		public M place(Object place){if(proxy)return proxy().place(place);  this.put("place", place);return this;};
	 	/** and place is null */
 		public M placeNull(){if(proxy)return proxy().placeNull();if(this.get("placeNot")==null)this.put("placeNot", "");this.put("place", null);return this;};
 		/** not .... */
 		public M placeNot(){if(proxy)return proxy().placeNot();this.put("placeNot", "not");return this;};
 		public M placeNotNull(){if(proxy)return proxy().placeNotNull();this.put("placeNot", "not");this.put("place", null);return this;};
 		public M placeNot(Object place){if(proxy)return proxy().placeNot(place);this.put("placeNot", "not");this.put("place", place);return this;};
	 		
			
		public M placeIn(String ids){
			if(proxy)return proxy().placeIn(ids);  this.put("placeIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 生日        **/
		public M birthday(Object birthday){if(proxy)return proxy().birthday(birthday);  this.put("birthday", birthday);return this;};
	 	/** and birthday is null */
 		public M birthdayNull(){if(proxy)return proxy().birthdayNull();if(this.get("birthdayNot")==null)this.put("birthdayNot", "");this.put("birthday", null);return this;};
 		/** not .... */
 		public M birthdayNot(){if(proxy)return proxy().birthdayNot();this.put("birthdayNot", "not");return this;};
 		public M birthdayNotNull(){if(proxy)return proxy().birthdayNotNull();this.put("birthdayNot", "not");this.put("birthday", null);return this;};
 		public M birthdayNot(Object birthday){if(proxy)return proxy().birthdayNot(birthday);this.put("birthdayNot", "not");this.put("birthday", birthday);return this;};
	 		
 		/** and birthday >= ? */
 		public M birthdayStart(Object start){if(proxy)return proxy().birthdayStart(start);this.put("birthdayStart", start);return this;};			
 		/** and birthday <= ? */
 		public M birthdayEnd(Object end){if(proxy)return proxy().birthdayEnd(end);this.put("birthdayEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 上级        **/
		public M mTop(Object mTop){if(proxy)return proxy().mTop(mTop);  this.put("mTop", mTop);return this;};
	 	/** and m_top is null */
 		public M mTopNull(){if(proxy)return proxy().mTopNull();if(this.get("mTopNot")==null)this.put("mTopNot", "");this.put("mTop", null);return this;};
 		/** not .... */
 		public M mTopNot(){if(proxy)return proxy().mTopNot();this.put("mTopNot", "not");return this;};
 		public M mTopNotNull(){if(proxy)return proxy().mTopNotNull();this.put("mTopNot", "not");this.put("mTop", null);return this;};
 		public M mTopNot(Object mTop){if(proxy)return proxy().mTopNot(mTop);this.put("mTopNot", "not");this.put("mTop", mTop);return this;};
	 		
			
		
			
	 	
			
		
		/** 上上级        **/
		public M mToptop(Object mToptop){if(proxy)return proxy().mToptop(mToptop);  this.put("mToptop", mToptop);return this;};
	 	/** and m_toptop is null */
 		public M mToptopNull(){if(proxy)return proxy().mToptopNull();if(this.get("mToptopNot")==null)this.put("mToptopNot", "");this.put("mToptop", null);return this;};
 		/** not .... */
 		public M mToptopNot(){if(proxy)return proxy().mToptopNot();this.put("mToptopNot", "not");return this;};
 		public M mToptopNotNull(){if(proxy)return proxy().mToptopNotNull();this.put("mToptopNot", "not");this.put("mToptop", null);return this;};
 		public M mToptopNot(Object mToptop){if(proxy)return proxy().mToptopNot(mToptop);this.put("mToptopNot", "not");this.put("mToptop", mToptop);return this;};
	 		
			
		
			
	 	
			
		
		/** 上级编号        **/
		public M tTop(Object tTop){if(proxy)return proxy().tTop(tTop);  this.put("tTop", tTop);return this;};
	 	/** and t_top is null */
 		public M tTopNull(){if(proxy)return proxy().tTopNull();if(this.get("tTopNot")==null)this.put("tTopNot", "");this.put("tTop", null);return this;};
 		/** not .... */
 		public M tTopNot(){if(proxy)return proxy().tTopNot();this.put("tTopNot", "not");return this;};
 		public M tTopNotNull(){if(proxy)return proxy().tTopNotNull();this.put("tTopNot", "not");this.put("tTop", null);return this;};
 		public M tTopNot(Object tTop){if(proxy)return proxy().tTopNot(tTop);this.put("tTopNot", "not");this.put("tTop", tTop);return this;};
	 		
			
		
			
	 	
			
		
		/** 上上级编号        **/
		public M tToptop(Object tToptop){if(proxy)return proxy().tToptop(tToptop);  this.put("tToptop", tToptop);return this;};
	 	/** and t_toptop is null */
 		public M tToptopNull(){if(proxy)return proxy().tToptopNull();if(this.get("tToptopNot")==null)this.put("tToptopNot", "");this.put("tToptop", null);return this;};
 		/** not .... */
 		public M tToptopNot(){if(proxy)return proxy().tToptopNot();this.put("tToptopNot", "not");return this;};
 		public M tToptopNotNull(){if(proxy)return proxy().tToptopNotNull();this.put("tToptopNot", "not");this.put("tToptop", null);return this;};
 		public M tToptopNot(Object tToptop){if(proxy)return proxy().tToptopNot(tToptop);this.put("tToptopNot", "not");this.put("tToptop", tToptop);return this;};
	 		
			
		
			
	 	
			
		public M distributor$on(Distributor.M value){if(proxy)return proxy().distributor$on(value);this.put("Distributor", value);value.put("on", "distributor");return this;};
 				
 			
		
		/** 配送商  [Distributor]      **/
		public M distributor(Object distributor){if(proxy)return proxy().distributor(distributor);  this.put("distributor", distributor);return this;};
	 	/** and distributor is null */
 		public M distributorNull(){if(proxy)return proxy().distributorNull();if(this.get("distributorNot")==null)this.put("distributorNot", "");this.put("distributor", null);return this;};
 		/** not .... */
 		public M distributorNot(){if(proxy)return proxy().distributorNot();this.put("distributorNot", "not");return this;};
 		public M distributorNotNull(){if(proxy)return proxy().distributorNotNull();this.put("distributorNot", "not");this.put("distributor", null);return this;};
 		public M distributorNot(Object distributor){if(proxy)return proxy().distributorNot(distributor);this.put("distributorNot", "not");this.put("distributor", distributor);return this;};
	 		
			
		public M distributorIn(String ids){
			if(proxy)return proxy().distributorIn(ids);  this.put("distributorIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** openId [非空]       **/
		public M openid(Object openid){if(proxy)return proxy().openid(openid);  this.put("openid", openid);return this;};
	 	/** and openid is null */
 		public M openidNull(){if(proxy)return proxy().openidNull();if(this.get("openidNot")==null)this.put("openidNot", "");this.put("openid", null);return this;};
 		/** not .... */
 		public M openidNot(){if(proxy)return proxy().openidNot();this.put("openidNot", "not");return this;};
 		public M openidNotNull(){if(proxy)return proxy().openidNotNull();this.put("openidNot", "not");this.put("openid", null);return this;};
 		public M openidNot(Object openid){if(proxy)return proxy().openidNot(openid);this.put("openidNot", "not");this.put("openid", openid);return this;};
	 		
			
		
			
	 	
			
		
		/** 授权情况    0:未授权 1:已授权     **/
		public M authStatus(Object authStatus){if(proxy)return proxy().authStatus(authStatus);  this.put("authStatus", authStatus);return this;};
	 	/** and auth_status is null */
 		public M authStatusNull(){if(proxy)return proxy().authStatusNull();if(this.get("authStatusNot")==null)this.put("authStatusNot", "");this.put("authStatus", null);return this;};
 		/** not .... */
 		public M authStatusNot(){if(proxy)return proxy().authStatusNot();this.put("authStatusNot", "not");return this;};
 		public M authStatusNotNull(){if(proxy)return proxy().authStatusNotNull();this.put("authStatusNot", "not");this.put("authStatus", null);return this;};
 		public M authStatusNot(Object authStatus){if(proxy)return proxy().authStatusNot(authStatus);this.put("authStatusNot", "not");this.put("authStatus", authStatus);return this;};
	 		
			
		public M authStatusIn(String ids){
			if(proxy)return proxy().authStatusIn(ids);  this.put("authStatusIn", ids);return this;
		};	
 			
		
			
	 	
			
		
		/** 邀请码        **/
		public M invitationCode(Object invitationCode){if(proxy)return proxy().invitationCode(invitationCode);  this.put("invitationCode", invitationCode);return this;};
	 	/** and invitation_code is null */
 		public M invitationCodeNull(){if(proxy)return proxy().invitationCodeNull();if(this.get("invitationCodeNot")==null)this.put("invitationCodeNot", "");this.put("invitationCode", null);return this;};
 		/** not .... */
 		public M invitationCodeNot(){if(proxy)return proxy().invitationCodeNot();this.put("invitationCodeNot", "not");return this;};
 		public M invitationCodeNotNull(){if(proxy)return proxy().invitationCodeNotNull();this.put("invitationCodeNot", "not");this.put("invitationCode", null);return this;};
 		public M invitationCodeNot(Object invitationCode){if(proxy)return proxy().invitationCodeNot(invitationCode);this.put("invitationCodeNot", "not");this.put("invitationCode", invitationCode);return this;};
	 		
			
		
			
	 	
			
		
		/** 添加时间 [非空]       **/
		public M addTime(Object addTime){if(proxy)return proxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	 	/** and add_time is null */
 		public M addTimeNull(){if(proxy)return proxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
 		/** not .... */
 		public M addTimeNot(){if(proxy)return proxy().addTimeNot();this.put("addTimeNot", "not");return this;};
 		public M addTimeNotNull(){if(proxy)return proxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
 		public M addTimeNot(Object addTime){if(proxy)return proxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	 		
 		/** and add_time >= ? */
 		public M addTimeStart(Object start){if(proxy)return proxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
 		/** and add_time <= ? */
 		public M addTimeEnd(Object end){if(proxy)return proxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 修改时间        **/
		public M updateTime(Object updateTime){if(proxy)return proxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	 	/** and update_time is null */
 		public M updateTimeNull(){if(proxy)return proxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
 		/** not .... */
 		public M updateTimeNot(){if(proxy)return proxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
 		public M updateTimeNotNull(){if(proxy)return proxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
 		public M updateTimeNot(Object updateTime){if(proxy)return proxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	 		
 		/** and update_time >= ? */
 		public M updateTimeStart(Object start){if(proxy)return proxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
 		/** and update_time <= ? */
 		public M updateTimeEnd(Object end){if(proxy)return proxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
			
			
		
			
	 	
			
		
		/** 状态 [非空]   1:正常 0:无效     **/
		public M status(Object status){if(proxy)return proxy().status(status);  this.put("status", status);return this;};
	 	/** and status is null */
 		public M statusNull(){if(proxy)return proxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
 		/** not .... */
 		public M statusNot(){if(proxy)return proxy().statusNot();this.put("statusNot", "not");return this;};
 		public M statusNotNull(){if(proxy)return proxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
 		public M statusNot(Object status){if(proxy)return proxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	 		
			
		public M statusIn(String ids){
			if(proxy)return proxy().statusIn(ids);  this.put("statusIn", ids);return this;
		};	
 			
		
			
	 	
	 	public M add(String key, Object value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	 	public M add(F key, Object value) {if(proxy)return proxy().add(key,value);this.put(key.toString(), value);return this;}
	 	
	 	public M desc(C key) {if(proxy)return proxy().desc(key);this.put("desc", key.column);return this;}
	 	public M asc(C key) {if(proxy)return proxy().asc(key);this.put("asc", key.column);return this;}
	 	public M desc(String sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	 	public M asc(String sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	 	public M definex(String sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	 	
	 	/** 获取所有会员信息 **/
		public @api List<Member> list(Integer size){			
			return getMemberList(this,size);
		}
		/** 获取会员信息分页 **/
		public @api Page<Member> page(Integer page,Integer size){			
			return getMemberPage(page, size , this);
		}
		/** 根据查询条件取会员信息 **/
		public @api Member get(){			
			return getMember(this);
		}
		/** 获取会员信息数 **/
		public @api Long count(){			
			return getMemberCount(this);
		}
		/** 获取会员信息表达式 **/
		public @api <T> T eval(String strEval){			
			return getMemberEval(strEval,this);
		}
		
		/** 获取会员信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey,int dateType){			
			return getMemberStats(this,sumKey,groupKey,dateType);
		}
		/** 获取会员信息统计 **/
		public @api List<Map> stats(C sumKey,C groupKey){			
			return getMemberStats(this,sumKey,groupKey,-1);
		}
		
		/** 根据条件更新 **/
		public @api int update(){			
			M where = null;
			M set = null;
			if(this.type==0){
				if(this.linked==null)throw new RuntimeException("未发set");
				where = this;
				set = this.linked;
			}else{
				if(this.linked==null)throw new RuntimeException("未发where条件");
				set = this;
				where = this.linked;
			}
			return updateMember(set,where);
		}
		/** 根据条件删除 **/
		public @api void delete(){			
			deleteMember(this);
		}
	}
	
	public static class Param extends M{
		public Param(int type) {
			super(type);
		}
		public Param(int type, Boolean proxy) {
			super(type, proxy);
		}
	}
	
	/** 对象的字段描述 **/
	public static class F{
		
			
		/** 用户编号 [非空]       **/
		public final static @type(Long.class)  String uid="uid";
	 			
			
	 	
			
		/** 用户名        **/
		public final static @type(String.class) @like String username="username";
	 			
			
	 	
			
		/** 密码        **/
		public final static @type(String.class)  String password="password";
	 			
			
	 	
			
		/** 头像        **/
		public final static @type(String.class)  String header="header";
	 			
			
	 	
			
		/** 昵称        **/
		public final static @type(String.class) @like String nickName="nickName";
	 			
			
	 	
			
		/** 真实姓名        **/
		public final static @type(String.class)  String realName="realName";
	 			
			
	 	
			
		/** 个人简介        **/
		public final static @type(String.class) @like String profile="profile";
	 			
			
	 	
			
		/** 邮箱        **/
		public final static @type(String.class)  String email="email";
	 			
			
	 	
			
		/** 手机        **/
		public final static @type(String.class) @like String mobile="mobile";
	 			
			
	 	
			
		/** QQ        **/
		public final static @type(String.class)  String qq="qq";
	 			
			
	 	
			
		/** 性别    1:男 0:女     **/
		public final static @type(Short.class)  String sex="sex";
	 			
			
	 	
			
		/** 所在地  [Region]      **/
		public final static @type(Long.class)  String place="place";
	 			
			
	 	
			
		/** 生日        **/
		public final static @type(Date.class)  String birthday="birthday";
	 			
	 	/** and birthday >= ? */
 		public final static @type(Date.class) String birthdayStart="birthdayStart";
 		/** and birthday <= ? */
 		public final static @type(Date.class) String birthdayEnd="birthdayEnd";
				
			
	 	
			
		/** 上级        **/
		public final static @type(String.class) @like String mTop="mTop";
	 			
			
	 	
			
		/** 上上级        **/
		public final static @type(String.class) @like String mToptop="mToptop";
	 			
			
	 	
			
		/** 上级编号        **/
		public final static @type(String.class)  String tTop="tTop";
	 			
			
	 	
			
		/** 上上级编号        **/
		public final static @type(String.class)  String tToptop="tToptop";
	 			
			
	 	
			
		/** 配送商  [Distributor]      **/
		public final static @type(Long.class)  String distributor="distributor";
	 			
			
	 	
			
		/** openId [非空]       **/
		public final static @type(String.class)  String openid="openid";
	 			
			
	 	
			
		/** 授权情况    0:未授权 1:已授权     **/
		public final static @type(Short.class)  String authStatus="authStatus";
	 			
			
	 	
			
		/** 邀请码        **/
		public final static @type(String.class)  String invitationCode="invitationCode";
	 			
			
	 	
			
		/** 添加时间 [非空]       **/
		public final static @type(Date.class)  String addTime="addTime";
	 			
	 	/** and add_time >= ? */
 		public final static @type(Date.class) String addTimeStart="addTimeStart";
 		/** and add_time <= ? */
 		public final static @type(Date.class) String addTimeEnd="addTimeEnd";
				
			
	 	
			
		/** 修改时间        **/
		public final static @type(Date.class)  String updateTime="updateTime";
	 			
	 	/** and update_time >= ? */
 		public final static @type(Date.class) String updateTimeStart="updateTimeStart";
 		/** and update_time <= ? */
 		public final static @type(Date.class) String updateTimeEnd="updateTimeEnd";
				
			
	 	
			
		/** 状态 [非空]   1:正常 0:无效     **/
		public final static @type(Short.class)  String status="status";
	 			
			
	 	
	 	public static String get(String name){
			try {
				Field field = F.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	/** 对象的数据库字段描述 **/
	public static enum C{
		
		uid("uid"),
		username("username"),
		password("password"),
		header("header"),
		nickName("nick_name"),
		realName("real_name"),
		profile("profile"),
		email("email"),
		mobile("mobile"),
		qq("qq"),
		sex("sex"),
		place("place"),
		birthday("birthday"),
		mTop("m_top"),
		mToptop("m_toptop"),
		tTop("t_top"),
		tToptop("t_toptop"),
		distributor("distributor"),
		openid("openid"),
		authStatus("auth_status"),
		invitationCode("invitation_code"),
		addTime("add_time"),
		updateTime("update_time"),
		status("status"),
		count("count");
		String column;
		C(String column){
			this.column = column;
		}
		public String toString(){
			return this.column;
		}
		public static String get(String name){
			try {
				Field field = C.class.getField(name);
				if(field!=null)
					return field.get(null).toString();
			} catch (Exception e) {
				//e.printStackTrace();
			}
			return null;
		}
	}
	
	
	
	
	/**
	* 获取会员信息数据
	**/
	public static Object getData(Object param){
		if(param==null)
			return null;
		Object value = null;
		if(param.getClass()==Long.class)
			value = Member.get((Long)param);
		else if(param instanceof java.util.Map){
			java.util.Map params = (Map) param;
			if(params.get("size")==null)
				value = Member.getMember(params);
			else
				value = Member.getMemberList(params, (Integer) params.get("size"));
		}else if(param.getClass()==Long.class )
			value =  Member.where().uid(param).get();
		else if(!Utils.empty(param.toString()))
			value = Member.get(Long.valueOf(param.toString()));
		return value;
	}
	
	/**对象转json**/
	public Map toJSON(){
		return toJSON(false);
	}
	public Map toJSON(boolean simple){
		return toJSON(simple,0);
	}
	public Map toJSON(boolean simple,int step){
		Map map = new HashMap();
		map.put("id",this.getUid());
	
		Utils.fms(map,simple?"":"uid",this.getUid(),this.getUid$());
		
			
 		
	
		Utils.fms(map,simple?"":"username",this.getUsername(),this.getUsername$());
		
			
 		
	
		Utils.fms(map,simple?"":"password",this.getPassword(),this.getPassword$());
		
			
 		
	
		Utils.fms(map,simple?"":"header",this.getHeader(),this.getHeader$());
		
			
 		
	
		Utils.fms(map,simple?"name":"nickName",this.getNickName(),this.getNickName$());
		
			
 		
	
		Utils.fms(map,simple?"name":"realName",this.getRealName(),this.getRealName$());
		
			
 		
	
		Utils.fms(map,simple?"":"profile",this.getProfile(),this.getProfile$());
		
			
 		
	
		Utils.fms(map,simple?"":"email",this.getEmail(),this.getEmail$());
		
			
 		
	
		Utils.fms(map,simple?"":"mobile",this.getMobile(),this.getMobile$());
		
			
 		
	
		Utils.fms(map,simple?"":"qq",this.getQq(),this.getQq$());
		
			
 		
	
		Utils.fms(map,simple?"":"sex",this.getSex(),this.getSex$());
		
			
 		
	
		Utils.fms(map,simple?"":"place",this.getPlace(),this.getPlace$());
		
			
 		
	
		Utils.fms(map,simple?"":"birthday",this.getBirthday(),this.getBirthday$());
		
			
 		
	
		Utils.fms(map,simple?"top":"mTop",this.getmTop(),this.getmTop$());
		
			
 		
	
		Utils.fms(map,simple?"toptop":"mToptop",this.getmToptop(),this.getmToptop$());
		
			
 		
	
		Utils.fms(map,simple?"top":"tTop",this.gettTop(),this.gettTop$());
		
			
 		
	
		Utils.fms(map,simple?"toptop":"tToptop",this.gettToptop(),this.gettToptop$());
		
			
 		
	
		Utils.fms(map,simple?"":"distributor",this.getDistributor(),this.getDistributor$());
		
			
 		
	
		Utils.fms(map,simple?"":"openid",this.getOpenid(),this.getOpenid$());
		
			
 		
	
		Utils.fms(map,simple?"status":"authStatus",this.getAuthStatus(),this.getAuthStatus$());
		
			
 		
	
		Utils.fms(map,simple?"code":"invitationCode",this.getInvitationCode(),this.getInvitationCode$());
		
			
 		
	
		Utils.fms(map,simple?"time":"addTime",this.getAddTime(),this.getAddTime$());
		
			
 		
	
		Utils.fms(map,simple?"time":"updateTime",this.getUpdateTime(),this.getUpdateTime$());
		
			
 		
	
		Utils.fms(map,simple?"":"status",this.getStatus(),this.getStatus$());
		
			
 		
	
		if(this.suffix!=null)map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOJSON************/
		/************LAZY3Q_DEFINE_TOJSON************/
		return map;
	}
	/**对象转map**/
	public Map toMap(){
		Map map = new HashMap();
	
		map.put("uid",this.getUid());
 		
	
		map.put("username",this.getUsername());
 		
	
		map.put("password",this.getPassword());
 		
	
		map.put("header",this.getHeader());
 		
	
		map.put("nickName",this.getNickName());
 		
	
		map.put("realName",this.getRealName());
 		
	
		map.put("profile",this.getProfile());
 		
	
		map.put("email",this.getEmail());
 		
	
		map.put("mobile",this.getMobile());
 		
	
		map.put("qq",this.getQq());
 		
	
		map.put("sex",this.getSex());
 		
	
		map.put("place",this.getPlace());
 		
	
		map.put("birthday",this.getBirthday());
 		
	
		map.put("mTop",this.getmTop());
 		
	
		map.put("mToptop",this.getmToptop());
 		
	
		map.put("tTop",this.gettTop());
 		
	
		map.put("tToptop",this.gettToptop());
 		
	
		map.put("distributor",this.getDistributor());
 		
	
		map.put("openid",this.getOpenid());
 		
	
		map.put("authStatus",this.getAuthStatus());
 		
	
		map.put("invitationCode",this.getInvitationCode());
 		
	
		map.put("addTime",this.getAddTime());
 		
	
		map.put("updateTime",this.getUpdateTime());
 		
	
		map.put("status",this.getStatus());
 		
	
		map.put("suffix", this.suffix);
		
		/************LAZY3Q_DEFINE_TOMAP************/
		/************LAZY3Q_DEFINE_TOMAP************/
		return map;
	}
	/**map转对象**/
	public static Member fromMap(Map map){
		Member member = new Member();
	
		member.uid = Utils.parseLong(map.get("uid"));
 		
	
		member.username = Utils.parseString(map.get("username"));
 		
	
		member.password = Utils.parseString(map.get("password"));
 		
	
		member.header = Utils.parseString(map.get("header"));
 		
	
		member.nickName = Utils.parseString(map.get("nickName"));
 		
	
		member.realName = Utils.parseString(map.get("realName"));
 		
	
		member.profile = Utils.parseString(map.get("profile"));
 		
	
		member.email = Utils.parseString(map.get("email"));
 		
	
		member.mobile = Utils.parseString(map.get("mobile"));
 		
	
		member.qq = Utils.parseString(map.get("qq"));
 		
	
		member.sex = Utils.parseShort(map.get("sex"));
 		
	
		member.place = Utils.parseLong(map.get("place"));
 		
	
		member.birthday = Utils.parseDate(map.get("birthday"));
 		
	
		member.mTop = Utils.parseString(map.get("mTop"));
 		
	
		member.mToptop = Utils.parseString(map.get("mToptop"));
 		
	
		member.tTop = Utils.parseString(map.get("tTop"));
 		
	
		member.tToptop = Utils.parseString(map.get("tToptop"));
 		
	
		member.distributor = Utils.parseLong(map.get("distributor"));
 		
	
		member.openid = Utils.parseString(map.get("openid"));
 		
	
		member.authStatus = Utils.parseShort(map.get("authStatus"));
 		
	
		member.invitationCode = Utils.parseString(map.get("invitationCode"));
 		
	
		member.addTime = Utils.parseDate(map.get("addTime"));
 		
	
		member.updateTime = Utils.parseDate(map.get("updateTime"));
 		
	
		member.status = Utils.parseShort(map.get("status"));
 		
	
		return member;
	}
	
	
	/**字段设置标记队列**/
	private Map<String,Boolean> seted=new HashMap();
	public Boolean getSeted(String key){
		return seted.get(key);
	}
	public void setSeted(String key){
		seted.put(key,true);
	}
	/**同步未set的字段**/
	public void mergeSet(Member old){
		Field[] fields = this.getClass().getDeclaredFields();
		try {
			for(Field field:fields){
				String key = field.getName();
				if(seted.get(key)==null && field.getAnnotation(column.class)!=null){
					field.setAccessible(true);
					field.set(this, field.get(old));					
				}
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	
		
	/**自定义变量存储**/
	private Map values=new HashMap();
	public Map getValues(){
		return values;
	}
	public void setValues(String name,Object value){
		values.put(name,value);
	}
	
	/**分表时的表名后缀**/
	private String suffix;
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
	
	
	/**获取数据库名称**/
	public static String getDataBaseName(){
		return Utils.config("spring.datasource.distribute_sys.name");
	}
	
	
	public static String getIcon(){
		return "/images/icons/2008112220121595877809.png";
	}
	public static String getIconfont(){
		return "icon-xietong2";
	}
	public static enum ACT{
		列表,添加,修改,详情
	};
	public static String getUrl(ACT act,Member.M params){
		if(params==null)params=new Member.M(0);
		params.remove("joins");
		params.remove("definexs");
		params.remove("distinct");
		String strUrl = "/admin/users/member.edit.html?";
		if(params.get("uid")!=null){
			strUrl+="&id="+Utils.encode(""+params.get("uid"),Utils.UTF8);
		}
		if(act==ACT.列表){
			strUrl = "/admin/users/member.html?1=1";
		
		}else if(act==ACT.添加){
			strUrl+="&edittype=insert";
		
		
		}else if(act==ACT.修改){
			strUrl+="&edittype=update";
		
		}else if(act==ACT.详情){
			strUrl+="&edittype=detail";
		
		}		
		if(params!=null){
			for(Object key:params.keySet()){
				strUrl+="&"+key+"="+Utils.encode(""+params.get(key),Utils.UTF8)+"";
			}
		}
		return strUrl;
	}
	public String getDetailUrl(){
		return this.getUrl(ACT.详情, where.uid(this.getId()));
	}
	
	/**
	* 转跳到当前地址
	**/
	public static Protocol redirect(Member.ACT act,Member.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_REDIRECT");
		protocol.set("url",Member.getUrl(act, params));
		return protocol;
	}
	/**
	* 打开一个新的tab页面
	**/
	public static Protocol href(Member.ACT act,Member.M params){
		Protocol protocol = Protocol.create(true,null,"ACT_HREF");
		protocol.set("url",Member.getUrl(act, params));
		protocol.set("title",act.name());
		return protocol;
	}
	/**
	* 显示一个消息框，并且关闭当前的对话框
	**/
	public static Protocol message(String message){
		Protocol protocol = Protocol.create(true,null,"ACT_MESSAGE");
		protocol.set("message",message);
		return protocol;
	}
	
	
	static com.distribute.framework.dao.IMemberDao getMemberDao(){
		return Utils.getBean("memberDao");
	};
	
}